using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TrafficMap : EntityTypeConfiguration<Traffic>
    {
        public TrafficMap()
        {
            // Primary Key
            this.HasKey(t => t.TIME);

            // Properties
            this.Property(t => t.TIME)
                .IsRequired()
                .HasMaxLength(5);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Traffic");
            this.Property(t => t.TIME).HasColumnName("TIME");
            this.Property(t => t.COUNT).HasColumnName("COUNT");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
